package com.example.poverty.service.impl;

import com.example.poverty.dao.VisitorWorkMapper;
import com.example.poverty.entity.VisitorWork;
import com.example.poverty.service.VisitorWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 前端  走访户工作 接口实现
 */
@Service
public class VisitorWorkServiceImpl implements VisitorWorkService {

    @Autowired
    private VisitorWorkMapper visitorWorkMapper;

    @Override
    public boolean insert(VisitorWork visitorWork) {
        return visitorWorkMapper.insert(visitorWork) > 0;
    }

    @Override
    public boolean update(VisitorWork visitorWork) {
        return visitorWorkMapper.update(visitorWork) > 0;
    }

    @Override
    public boolean delete(Integer id) {
        return visitorWorkMapper.delete(id) > 0;
    }

    @Override
    public VisitorWork selectByPrimaryKey(Integer id) {
        return visitorWorkMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<VisitorWork> allVisitorWork() {
        return visitorWorkMapper.allVisitorWork();
    }

    @Override
    public VisitorWork getByName(String name) {
        return visitorWorkMapper.getByName(name);
    }
}
